import request from '@/utils/request'

// 获取机构树
export function treeSelectDept(orgId) {
  return request({
    //url: '/fxfz/sOrg/listOrgTree?orgId=0',
    url: '/fxfz/sOrg//getOrgById?orgId='+orgId,
    method: 'get',
  })
}
// 获取机构树
export function treeSelectDepts() {
  return request({
    url: '/fxfz/sOrg/listOrgTree?orgId=0',
    // url: '/fxfz/sOrg//getOrgById?orgId='+orgId,
    method: 'get',
  })
}
export function treeAllSelectDept() {
  return request({
    url: '/fxfz/sOrg/listOrgTree?orgId=0',
    method: 'get',
  })
}

// 获取机构人员
export function queryUserList(query) {
  return request({
    url: '/fxfz/suser/queryUsersByOrg',
    method: 'get',
    params: query
  })
}

// 新增小组
export function addGroup(query) {
  return request({
    url: '/group/save',
    method: 'post',
    data: query
  })
}

// 获取小组
export function getGroup(query) {
  return request({
    url: `/group/page`,
    method: 'get',
    params: query
  })
}

// 查看小组
export function detilGroup(query) {
  return request({
    url: '/group/findById',
    method: 'get',
    params:query
  })
}

// 删除小组
export function delGroup(ids) {
  return request({
    url: `/group/delete?ids=`+ids,
    method: 'post',
    data:ids
  })
}

// 修改小组
export function updateGroup(query) {
  return request({
    url: '/group/update',
    method: 'post',
    data: query
  })
}